package com.wnn.demo.model.hospital.mapper;

import com.wnn.demo.domain.Department;
import com.wnn.demo.utils.IBaseMapper;
import com.wnn.demo.vo.DeptTreeVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;


/**
* Created by Mybatis Generator on 2019/10/28
*/

public interface DepartmentMapper extends IBaseMapper< Department > {


    List< Map< Object, String>> selectDepartmentAll(@Param("type") Integer type);

    /**
     * 查询全部部门树列表 根据医院的id链表查询医院拥有的部门加上自定义check字段
     * @param hospitalId
     *  @param isCheckArr  '1'的时候 为医院拥有的部门
     * @return
     */
    List< DeptTreeVo> selectDeptTreeList(@Param("hospitalId") String hospitalId , String employeeId, @Param("isCheckArr") String isCheckArr);

    int deleteHospAndDept(@Param("hospitalId") String hospitalId, @Param("deptIds") String deptIds);

    int insertHospAndDept(@Param("id") String id, @Param("hospitalId") String hospitalId, @Param("deptId") String deptId );

    /**
     * 通过医院ID查找医院拥有的部门
     * @param hospitalId
     * @return
     */
    List< Department> selectDeptByHospitalId(@Param("hospitalId") String hospitalId);
}